package com.jzcn.common.exceptions;


import com.jzcn.common.response.ResponseCode;
import com.jzcn.common.response.ResponseResult;

/**
 * @author peng.l
 * @version 0.0.1
 * @date 2020/10/18 23:40
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 4868842805385777275L;

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public BusinessException() {
    }

    public BusinessException(String message) {
        super(message);
        this.code = ResponseResult.ERROR_CODE;
    }

    public BusinessException(ResponseCode status) {
        super(status.message());
        this.code = status.code();
    }
}
